<%--
  @author Tharanga Punchihewa
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript ">
    $(document).ready(function() {
        $('.organization-list').dataTable({
            "sPaginationType": "full_numbers",
            "bDestroy": true,
            "oLanguage": {
                "sZeroRecords": $('#no-record').val(),
                "sLengthMenu": $('#display').val() + " _MENU_ " + $('#records').val(),
                "sSearch": $('#search').val(),
                "sInfo": $('#showing').val() + " _START_ " + $('#to').val() + " _END_ " + $('#of').val() + " _TOTAL_ " + $('#entries').val(),
                "sInfoEmpty": $('#no-record').val(),
                "oPaginate": {
                    "sFirst": $('#first').val(),
                    "sLast": $('#last').val(),
                    "sNext": $('#next').val(),
                    "sPrevious": $('#previous').val()
                }
            }
        });
    });
</script>

<div id="land-registration-module-home-title" class="module-home-title">
    <%--<s:a href="landInterests.do"><img src="${pageContext.request.contextPath}/images/land-reg.png"
                                             alt="Land Registration"><span><s:label
            value="Land Interests"/></span></s:a>--%>
    <s:if test="pageMode ==6">
        <s:a href="goInterestsHome.do"><img src="${pageContext.request.contextPath}/images/interest-party.png"
                                                   alt="Organizational Information"><span><s:label
                value="%{getText('manage_organization_interest.label')}"/></span></s:a>
        <span class="module-title-breaker"> > </span>
        <s:a href="#"><img src="${pageContext.request.contextPath}/images/company-profile.png"
                           alt="Organizational Information"><span><s:label
                value="%{getText('edit_go_interest_information.label')}"/></span></s:a>
    </s:if>
    <s:elseif test="pageMode ==7">
        <%--ORPII Approve or Reject Interest--%>
        <s:a href="home.do"><img src="${pageContext.request.contextPath}/images/home.png"
                                        alt="Organizational Information"><span><s:label
                value="%{getText('manage_organization_interest.label')}"/></span></s:a>
        <span class="module-title-breaker"> > </span>
        <s:a href="approveGOInterestInformationList.do"><img src="${pageContext.request.contextPath}/images/accept.png"
                                                             alt="Organizational Information"><span><s:label
                value="%{getText('go_interest_info_approval.label')}"/></span></s:a>
    </s:elseif>
    <s:elseif test="pageMode ==8">
        <s:a href="goInterestsHome.do"><img src="${pageContext.request.contextPath}/images/interest-party.png"
                                                   alt="Organizational Information"><span><s:label
                value="%{getText('manage_organization_interest.label')}"/></span></s:a>
        <span class="module-title-breaker"> > </span>
        <s:a href="#"><img src="${pageContext.request.contextPath}/images/registration-form.png"
                           alt="Organizational Information"><span><s:label
                value="%{getText('active_inactive_go_interest_info.label')}"/></span></s:a>
    </s:elseif>
    <s:elseif test="pageMode ==10">
        <s:a href="goInterestsHome.do"><img src="${pageContext.request.contextPath}/images/interest-party.png"
                                                   alt="Organizational Information"><span><s:label
                value="%{getText('manage_organization_interest.label')}"/></span></s:a>
        <span class="module-title-breaker"> > </span>
        <s:a href="#"><img src="${pageContext.request.contextPath}/images/search.png"
                           alt="Organizational Information"><span><s:label
                value="%{getText('search_go_interest_information.label')}"/></span></s:a>
    </s:elseif>
</div>
<s:if test="hasActionErrors() || hasActionMessages()">
    <div id="message-box" class="message-box">
        <div class="action-msg"><s:actionmessage/></div>
        <div class="action-err"><s:actionerror/></div>
    </div>
</s:if>
<div class="page-title">
    <s:if test="pageMode==10">
        <h2><s:label value="%{getText('search_go_interest_information.label')}"/></h2>
    </s:if>
    <s:elseif test="pageMode ==6">
        <h2><s:label value="%{getText('edit_go_interest_information.label')}"/></h2>
    </s:elseif>
    <s:elseif test="pageMode ==8">
        <h2><s:label value="%{getText('active_inactive_go_interest_info.label')}"/></h2>
    </s:elseif>
    <s:else>
        <h2><s:label value="%{getText('go_interest_info_approval.label')}"/></h2>
    </s:else>
</div>
<table class="width-100 margin-10-auto table organization-list">
    <thead>
    <tr class="center-align table-header">
        <th><s:label value="%{getText('Reference Number')}"/></th>
        <s:if test="pageMode ==6">
            <th><s:label value="%{getText('status.label')}"/></th>
            <th><s:label value="%{getText('edit.label')}"/></th>
        </s:if>
        <s:if test="pageMode ==7">
            <th><s:label value="%{getText('status.label')}"/></th>
            <th><s:label value="%{getText('approve_button.label')}"/></th>
        </s:if>
        <s:if test="pageMode==8">
            <th><s:label value="%{getText('status.label')}"/></th>
            <th><s:label value="%{getText('active.label')}"/></th>
        </s:if>
        <s:if test="pageMode==10">
            <th><s:label value="%{getText('status.label')}"/></th>
            <th><s:label value="%{getText('view.label')}"/></th>
        </s:if>
    </tr>
    </thead>
    <tbody>
    <s:iterator status="status1" value="goInterestInformationList">
        <tr>
            <td class="center-align">
                <s:property value="referenceNumber"/>
            </td>
            <s:if test="pageMode ==6">
                <td class="center-align">
                    <s:label value="%{status}"/>
                </td>
                <td class="center-align">
                    <s:url id="initEditGOInterestInformation" action="initEditGOInterestInformation">
                        <s:param name="goInterestInformationId" value="id"/>
                    </s:url>
                    <s:a href="%{initEditGOInterestInformation}">
                        <img src="<s:url value='/images/modify-form.png'/>" border="none" width="25"
                             height="25" title="Edit"/>
                    </s:a>
                </td>
            </s:if>
            <s:if test="pageMode ==7">
                <td class="center-align">
                    <s:label value="%{status}"/>
                </td>
                <td class="center-align">
                    <s:url id="initApproveGOInterestInformation" action="initApproveGOInterestInformation">
                        <s:param name="goInterestInformationId" value="id"/>
                    </s:url>
                    <s:a href="%{initApproveGOInterestInformation}">
                        <img src="<s:url value='/images/approve.png'/>" border="none" width="25"
                             height="25" title="Approve"/>
                    </s:a>
                </td>
            </s:if>
            <s:elseif test="pageMode==8">
                <td class="center-align">
                    <s:label value="%{status}"/>
                        <%--<s:if test="status.ordinal()== 0">--%>
                        <%--<s:label value="%{getText('data_entry.label')}"/>--%>
                        <%--</s:if>--%>
                        <%--<s:elseif test="status.ordinal()== 1">--%>
                        <%--<s:label value="%{getText('pending.label')}"/>--%>
                        <%--</s:elseif>--%>
                        <%--<s:elseif test="status.ordinal()== 2">--%>
                        <%--<s:label value="%{getText('rejected.label')}"/>--%>
                        <%--</s:elseif>--%>
                        <%--<s:elseif test="status.ordinal()== 3">--%>
                        <%--<s:label value="%{getText('approved.label')}"/>--%>
                        <%--</s:elseif>--%>
                </td>
                <td class="center-align">
                    <s:if test="!isActive()">
                        <s:url id="activeGOInterestInformation" action="activeGOInterestInformation">
                            <s:param name="goInterestInformationId" value="id"/>
                        </s:url>
                        <s:a href="%{activeGOInterestInformation}">
                            <img src="<s:url value='/images/approve.png'/>" class="image-icon" title="Active"/>
                        </s:a>
                    </s:if>
                    <s:if test="isActive()">
                        <s:url id="inactiveGOInterestInformation" action="inactiveGOInterestInformation">
                            <s:param name="goInterestInformationId" value="id"/>
                        </s:url>
                        <s:a href="%{inactiveGOInterestInformation}">
                            <img src="<s:url value='/images/reject.png'/>" class="image-icon" title="Inactive"/>
                        </s:a>
                    </s:if>
                </td>
            </s:elseif>
            <s:elseif test="pageMode==10">
                <td class="center-align">
                    <s:if test="status.ordinal()== 0">
                        <s:label value="%{getText('data_entry.label')}"/>
                    </s:if>
                    <s:elseif test="status.ordinal()== 1">
                        <s:label value="%{getText('pending.label')}"/>
                    </s:elseif>
                    <s:elseif test="status.ordinal()== 2">
                        <s:label value="%{getText('rejected.label')}"/>
                    </s:elseif>
                    <s:elseif test="status.ordinal()== 3">
                        <s:label value="%{getText('approved.label')}"/>
                    </s:elseif>
                </td>
                <td class="center-align">
                    <s:url id="searchGOInterestInformation" action="searchGOInterestInformation">
                        <s:param name="goInterestInformationId" value="id"/>
                    </s:url>
                    <s:a href="%{searchGOInterestInformation}">
                        <img src="<s:url value='/images/company-profile.png'/>" class="image-icon"
                             title="View Interest Details"/>
                    </s:a>
                </td>
            </s:elseif>
        </tr>

    </s:iterator>
    </tbody>
</table>
<s:include value="../dataTableLocalizationLabels.jsp"/>